{% extends "base.html" %}

{% block head %}
  <script type="text/javascript">
  //<![CDATA[

  //]]>
  </script>
  
  <style type="text/css">
    
  </style>
{% endblock %}

{##############################################################################}

{% block body %}
  <div class="menu">
    <span class="item"><a href="/inbox">My Inbox</a></span>
    <span class="item"><a href="/about">What is this site ?</a></span>
  </div>
  <div class="table">
    {% if past_events %}
    <table>
      <tr>
        <th>Historical Event</th>
        <th>Total Comments</th>
        <th>Last Edited</th>
      </tr>
      </tr>
      {% for event in past_events %}
        <tr id="row{{ forloop.counter }}">
          <td class="main">
            <div class="name"><a {% if not event.archived %}class="active"{% endif %} href="/event?id={{ event.key|stringformat:"s"|urlencode }}">{{ event.name|escape }}</a></div>
          </td>
          <td class="total_comments">
            {{ event.total_comments }}
          </td>
          <td class="date">
            {{ event.updated|date:"D, M j, Y \a\t P" }}
          </td>
        </tr>
      {% endfor %}
    </table>
    {% endif %}
    {% if not past_events %}
      <div class="message">There is no historical event. Go to your <a href="/inbox">inbox</a> to create one !</div>
    {% else %}
      {% if not archive %}
        <div class="message">Showing only active historical events. Looking for something archived ?  <a href="{{ request.path }}?archive=1">Show all</a></div>
      {% endif %}
    {% endif %}
  </div>
  
  <div class="table">
    {% if spec_events %}
    <table>
      <tr>
        <th>Speculative Event</th>
        <th>Completion</th>
        <th>Total Comments</th>
        <th>Last Edited</th>
      </tr>
      </tr>
      {% for event in spec_events %}
        <tr id="row{{ forloop.counter }}">
          <td class="main">
            <div class="name"><a {% if not event.archived %}class="active"{% endif %} href="/event?id={{ event.key|stringformat:"s"|urlencode }}">{{ event.name|escape }}</a></div>
          </td>
          <td class="completion">
            {{ event.completion }}
          </td>
          <td class="total_comments">
            {{ event.total_comments }}
          </td>
          <td class="date">
            {{ event.updated|date:"D, M j, Y \a\t P" }}
          </td>
        </tr>
      {% endfor %}
    </table>
    {% endif %}
    {% if not spec_events %}
      <div class="message">There is no speculative event. Go to your <a href="/inbox">inbox</a> to create one !</div>
    {% else %}
      {% if not archive %}
        <div class="message">Showing only active speculative events. Looking for something archived ?  <a href="{{ request.path }}?archive=1">Show all</a></div>
      {% endif %}
    {% endif %}
  </div>
{% endblock %}

{##############################################################################}

{% block footer %}
{% endblock %}
